home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
batch
/
scanbat
/
quick.doc
< prev
next >
Wrap
Text File
|
1990-01-10
|
34KB
|
1,099 lines
S C A N L O N E N T E R P R I S E S
B A T C H F I L E U T I L I T I E S
Version 2.2 (SEBFU)
(C) 1989
Q U I C K R E F E R E N C E G U I D E
ADD Syntax : ADD var v
Where 'var' is any legal Dos variable, previously assigned at
least zero (set var=0) and 'v' is the amount to add to 'var', and
is in the range of 0 thru 9, with a default value of 1, if 'v' is
not specified.
BEEP Syntax : BEEP [n] [P] [K]
Where 'n' specifies the number of beeps, 'P' causes the beeps to
occur every second (instead of right away) and 'K' causes the
beeps to occur every second until a key is pressed.
BIGLTR Syntax : BIGLTR message, bc fc
Where 'message' is any 10 alpha numeric characters (ascii values
in the range of 0 thru 255), 'bc' is the background color and
'fc' the foreground color. This command will display, starting
at the current row and column, any text included in 'message', as
long as you do not exceed the 10 character limit. If 'message'
is longer than 10 characters, then 'message' will be truncated at
the tenth character. The characters so displayed will be large
characters of 9 rows by 8 columns.
CDCK Syntax : CDCK
Simply returns an errorlevel of 1 if the CD-Rom driver is
present, else returns an errorlevel of 0.
CDD Syntax : CDD n
Where 'n' is the number of directory levels to move toward the
root directory.
CGABORDR Syntax : CGABORDR n
Changes the CGA border color to the selected value of 'n'.
CHGC Syntax : CHGC sr sc er ec bc fc
Changes the screen colors, without affecting the screen
characters, for the selected screen range.
Where 'sr' is the start row, 'sc' the start column, 'er' the
ending row, 'ec' the ending column, 'bc' the background color and
'fc' the foreground color.
Page 2
Q U I C K R E F E R E N C E
SEBFU Version 2.2
CHGLOCK Syntax : CHGLOCK [C] [N] [S]
Toggles the existing state of the selected lock key, where,
C=caps lock, N=num lock and S=Scroll lock. CHGLOCK without any
parameters causes all current settings to reverse (toggle).
CHKSUM Syntax : CHKSUM fname n
Where 'fname' is the file to get a check sum for, and 'n' is an
optional checksum value to compare the calculated one with.
CK101
Returns an errorlevel of 0 if a 101 type keyboard is attached,
providing the Rom Bios supports this mode, else returns an
errorlevel of 1.
CKCLK
Returns an errorlevel of 1 if Dos reports the year 1980 else
returns an errorlevel of 0. Use this as a first guess that the
Dos time and date has been set.
CLR sr sc er ec bc fc
Clears the screen starting at the specified row 'sr' and column
'sc' thru row 'er' and column 'ec' using the specified colors
'bc' (background) and 'fc' (foreground).
CLRKEY
Clears the type ahead buffer. Prevents the user from entering
responses in advance of the questions or prompts.
COFF
Toggles the cursor off on most MGA and CGA systems, but will NOT
always work on MGA systems, and won't work on EGA or VGA systems.
COLOR bc fc
Sets the screen colors, providing that ANSI.SYS or other ANSI
driver has been installed. The colors are set to the selected
background 'bc' and foreground 'fc' color. Prior to using this,
use our DETANSI function to check for the existence of the driver
CR
Waits for the ENTER key to be pressed. All key strokes simply
cause the speaker to beep.
Page 3
Q U I C K R E F E R E N C E
SEBFU Version 2.2
CT
Toggles the cursor on or off, depending upon which state it is
currently in. CT does NOT work on all systems.
CUON
Makes the cursor visible.
CURKEY
Returns an errorlevel of 1 thru 4 depending upon which of the
four cursor control keys is pressed. The four values are :
1 = up arrow 2 = down arrow
3 = left arrow 4 = right arrow
If the enter key is pressed or escape keys are pressed, the an
errorlevel of 0 is returned, any other key press will result in
the speaker beeping.
DAYOFMO
Returns an errorlevel of 1 thru 31 for the current day of the
month as reported by Dos. Dos must have the correct time and
date for this to function properly. To determine if the Dos time
and Date are set, use our CKCLK function.
DAYOFWK [mm-dd-yy] [D]
In the functions basic format, returns an errorlevel representing
the day of week (Sunday = 1 .... Saturday = 7). In the second
format, the user specifies the date to return the day of week for
in the format 'mm-dd-yy' and finally the last format returns the
day of month, by appending the letter 'D' (upper or lower case)
after the function name.
DBLBOX sr sc er ec bc fc Pp
Draws a double line graphics box starting at row 'sr', column
'sc' and ending at row 'er' column 'ec', using the background
color 'bc' and foreground color 'fc' on page 'p' (prefixed by the
P {upper or lower case}).
DETANSI
Returns an errorlevel of 1 if an ansi device drive is installed,
a 0 if an ansi driver is not installed, or a 2 if the video mode
is graphics.
Page 4
Q U I C K R E F E R E N C E
SEBFU Version 2.2
DFREE d: [vname]
Returns an errorlevel in K bytes for bytes available on a
selected drive 'd:', or places the exact value in a selected
variable 'vname'. The selected drive letter may be upper or lower
case, and must be prefixed with the colon. Alternately, will
return an errorlevel of 0 if an incorrect drive is specified and
the variable is not specified, or a 1 if the variable is
specified and the selected drive is not available.
DLINE sr sc l bc fc p S
DLINE Pp l S
Draws a double or single line, using double or single line
graphics on the video or sends the line to the selected printer,
using length 'l', starting on row 'sr' column 'sc' (video), using
the background color 'bc' and foreground color 'fc' on page 'p'.
DLST ftype [/Ln] [/Rn] [/Bn] [/Tn] [/E list]
[/I list] [/X] [/D] [/Z]
Displays a list of files in the current directory, where :
ftype is the type of file(s) to display, and can use the Dos
wildcards (*.*, ???.???).
/Ln = Left margin of 'n' /Rn = Right margin of 'n'
/Bn = Last margin 'n' to use /Tn = First line to use 'n'
/E list = exclude list /I list = include list
/X = no extensions shown /D = show directories
/Z = stop listing at line 'Bn'
Under normal execution (without the /Z option), if the list is
longer than rows Tn thru Bn then the function halts, waiting for
the user to press enter to continue.
DRVCK d:
Returns an errorlevel of 0 if the specified drive exists, a 1 if
the drive does not, or 2 if the drive was not specified. This
does not check to see if a drive is installed, only if the drive
is a valid drive.
DRVLST var
Returns a list of logical drives in the system. The list of
drives will be in variable 'var'. This list is not limited to
physical drives.
Page 5
Q U I C K R E F E R E N C E
SEBFU Version 2.2
DSKRDY d:
Returns an errorlevel of 0 if the drive is ready, with a
formatted disk, an errorlevel of 1 if the drive exists, but is
not ready, 2 if the drive has an unformatted disk installed, and
3 if the drive does not exist.
ENVSIZE [TL] [L] [T] [TS] [TK] [B] [K] [V] [R]
Returns an errorlevel based upon the amount of Dos environment
space left or the total environment space size.
FCHR sr sc er ec bc fc p c
Fills the selected video area with the selected character, where:
sr = start row sc = start column
er = ending row ec = ending column
bc = background color fc = foreground color
p = video page c = fill character
Any single character entered for 'c' results in that character
being used as the fill pattern, if two or more characters are in
the 'c' position, then it is assumed you want to use a decimal
value, and may be from 2 to 3 decimal digits (0-9) ranging in
value from 0 to 255. For characters with values less than 10,
prefix the value with a zero.
FILES ftype vname /E list /I list
Returns an errorlevel equal to the number of files of the type
'type'. User may specify additional file types by using the /I
followed by a list (of up to 10) additional extension types, or
may exclude file types from a listing when using the "*" wild
card, by entering a /E followed by up to 10 extension types.
Alternately, the number of files will be returned in a selected
variable.
FREEM [var] [/E]
Displays the amount of system Ram left for use, or sets the
variable 'var' to that value, or using the optional '/E' switch,
sets the Dos errorlevel equal to the remaining size in 4K chunks
or the specified variable to the remaining size in 4K chunks.
EXAMPLE 1:
FREEM
Simply displays the amount of ram available for a program.
Page 6
Q U I C K R E F E R E N C E
SEBFU Version 2.2
EXAMPLE 2:
FREEM MEM
Sets the Dos variable 'MEM' equal to the amount of ram available.
EXAMPLE 3:
FREEM /E
Sets the Dos errorlevel (readable from a batch file) to the
amount of ram divided by 4000 (IE...64K =16, 128K=32, etc...)
FSIZE fname vname
Returns an errorlevel of 0 thru 255 for the size of the file
'fname', or alternately places the size (in K bytes) into the
variable 'vname'.
FUNKEY
Returns an errorlevel of 1 thru 10 for the 10 function keys, all
other key presses cause the speaker to beep.
GALF
Returns an errorlevel of 1 thru 26 for any alpha key pressed,
upper or lower case, all other key presses causes the speaker to
beep.
GCURS [R] [Rv] [C] [Cv] [V]
Returns an errorlevel for either the row or column position of
the cursor, or alternately places the row / column information
into the variables ROW and COL.
GDIR
Sets the Dos variable DIR to the current directory path.
GDRIVE
Returns an errorlevel from 0 thru 255 for the current active
drive, where 0=A, 1=B, etc...
GETCC [V]
Returns an errorlevel equal to the cursor column number, or
alternately places the value into a DOS variable CC, if the
switch V is included on the command line
Page 7
Q U I C K R E F E R E N C E
SEBFU Version 2.2
GETCOLR [F] [B]
Returns an errorlevel equal to the current screen colors, where
'F' specifies the foreground and 'B' the background.
GETCR [V]
Returns an errorlevel equal to the current cursor row, or returns
the value in the variable CR, if the switch V is included on the
command line.
GETMCB
Displays a list, showing the current memory usage.
GETNUM [n....]
Returns an errorlevel equal to the value of the numeric key
pressed, or sounds the speaker if any other key is pressed.
Alternately, the user may specify which numeric keys are
acceptable.
GETPG
Returns an errorlevel equal to the active video page. For CGA
systems, this is usually a value between 1 and 4.
GETVER [M] [V]
Returns an errorlevel equal to the current Dos version (0 if Dos
version 1.x) or alternately can set the Dos variable VER to the
version number.
GMEN [B] [s] [V]
Returns an errorlevel equal to the amount of ram left for use in
the system, where 'B' returns the value in 4K byte chuncks, 's'
is a comparision value, and returns an errorlevel of 0 if equal
and 1 if unequal, 'V' places the actual ram size into the
variable MEM .
Page 8
Q U I C K R E F E R E N C E
SEBFU Version 2.2
GMODE
Returns an errorlevel equal to the current video mode, where :
0 = CGA 40x25 black & white
1 = CGA 40x25 color
2 = CGA 80x25 black & white
3 = CGA 80x25 color
4 = 320x200 4 color graphics mode
5 = 320x200 4 color graphics mode (color burst off)
6 = 640x200 2 color graphics mode
7 = 80x25 Monochrome adapter
8 = 160x200 16 color graphics mode (PCjr)
9 = 320x200 16 color graphics mode (PCjr)
10 = 640x200 4 color graphics mode (PCjr)
11 = ?
12 = ?
13 = 320x200 16 color graphics mode (EGA)
14 = 640x200 16 color graphics mode (EGA)
15 = 640x350 monochrome graphics mode (EGA)
16 = 640x350 4 color graphics mode (EGA)
Page 9
Q U I C K R E F E R E N C E
SEBFU Version 2.2
INKEY {key_val},/EAZXScCbc,fc
Retrieves single keystrokes, setting the errorlevel to the ascii
value of the keystroke, or alternately allows assigning values to
specific keys, where :
E = echo mode on (echo char entered)
A = set error level to ascii if no assignment
Z = set error level to 0 if no assignment
X = respond to extended keys only
Predefined return codes for extended keys are :
UP = 1 DOWN = 2 LEFT = 3
RIGHT = 4 PAGE UP = 5 PAGE DOWN = 6
HOME = 7 END = 8 INSERT = 9
DELETE = 9
FUNCTION KEYS 1 THRU 10 = 10 THRU 19
S = set list separator (separator follows the S), default
is a comma
C = color, background color (decimal) is immediately
after the S, followed by the separator char, then the
foreground color
INSTR s c vname oname [/X]
Searches for the first occurrence of 'c' starting at 's' in
variable 'vname', to output variable 'oname'. The search
character must be specified as a decimal value (IE...65=A),
unless the switch '/X' is included on the command line.
INVERT
Swaps the foreground an background colors, of the entire screen.
If the foreground color is greater than 15 then the background
color will blink on Monochrome and CGA systems.
KEYSTAT
Returns an errorlevel of 0 thru 4, where :
1 = Scroll lock on 2 = Num lock on
4 = Caps lock on 0 = All locks off
LEN vname
Returns an errorlevel equal to the length of the specified
variable 'vname', or a zero if the variable does not exist, or is
not specified.
Page 10
Q U I C K R E F E R E N C E
SEBFU Version 2.2
LIMCK
Returns an errorlevel of 1 if a LIM driver is detected, else
returns a zero.
LINE sr sc l [bc fc] [Pn]
Draws a line, using single line graphics, starting on row 'sr',
column 'sc'for length 'l', using optional background 'bc' and
foreground 'fc' colors on the optional page 'Pn'.
LOCATE sr sc p
Positions the video cursor to the location specified, where 'sr'
is the row, and 'sc' is the column. Alternately, the video page
may be specified 'p'
LOGON [O]
Updates a file (LOGIN.LOG), with login name, time and date, or
alternately, the logout name, time and date.
LPT1TO2 (or PRNSWAP)
Reassigns printer port 1 as printer port 2, and printer port 2
becomes printer port 1, and may be referred to as the PRN device.
LST fname
Displays the file 'fname', one page at a time. The text file may
be scrolled by pressing either the space bar, or by pressing the
enter key. Scrolling backwards is not allowed.
The utility also returns an errorlevel of 0 if everything was ok,
and errorlevel of 1 if the file was not found, or and errorlevel
of 2 if the file was not specified.
Pressing the escape key at any time exits.
MIDSTR s l vname oname
Places a selected portion of the string 'vname' into the output
string 'oname', where 's' is the start of the string to extract
from 'vname', and 'l' is the length (number of characters) to
extract, starting at 's'.
MOUSECK
Returns an errorlevel of 0 if a mouse driver is not detected, or
an errorlevel of 1 if it is.
Page 11
Q U I C K R E F E R E N C E
SEBFU Version 2.2
MOVCUR [U] [D] [L] [R] [n]
Moves the cursor in the desired direction :
U = up D = down
L = left R = right
by an optional value of 'n' or the default value of 1.
PAGE p V
Returns an errorlevel equal to the current video page, or sets
the active video page to 'p', or returns the active video page
number in the variable PAGE, if the switch V is found on the
command line.
PASSWORD [S]
Prompts the user for a password. The entered password is hidden
by use of inverse video characters as the password is entered.
PASSWORD allows 3 attempts at the password, then locks up the
system, forcing the user to reboot. Alternately, the user may
append an 'S' after the function name, and after entering the
correct current password, will be prompted for a new password.
PATHCK name
Checks for the existence of the directory 'name' in the current
directory. If the directory 'name' exists, an errorlevel of 0 is
returned, if 'name' does not exist, then an errorlevel of 1 is
returned, and if 'name' is not specified, then an errorlevel of 2
is returned.
PFF
Sends a form feed to the PRN device (first printer - LPT1).
PRDY
Returns an errorlevel depending upon the status of the first
printer (PRN or LPT1), where :
0 = OK 1 = Timed out
2 = Gen Failure 3 = No paper
4 = Busy 5 = Off line
Page 12
Q U I C K R E F E R E N C E
SEBFU Version 2.2
PRINT message
Sends the string 'message' to the PRN (LPT1) device. Accepts
only input that Dos allows on the command line. Don't use the
redirectors '<' or '>' or pipe '|', unless enclosed in
parentheses
PRINTC n
Prints the ascii character represented by the numeric decimal
value 'n', or multiple characters separated by spaces.
PRINTF name
Sends any file, up to 64k bytes, to the printer. No special
controls are performed. This is only a convenience to the user,
as the Dos COPY command can just as easily be used.
PRNSET
Performs a hardware reset to the PRN device.
RESPONSE var bc fc l [N]
Sets the variable 'var' to the text entered from the keyboard,
using the optional colors for background 'bc' and foreground 'fc'
but requires the length to be specified. 'N' is a switch which
prevents keystrokes from being echoed to the display, this is
useful for use as Password entry.
SAVEKEY [c] [/n]
Places keystrokes 'c' (litteral) or '/n' decimal into the
type-ahead buffer.
SCROLL sr sc er ec bc fc [D]
Scrolls a selected portion of the screen up or down, using
optional colors.
SCROLMSG [/bc fc l] message
Displays the string 'message' on line 25, scrolling it from right
to left, optionally, the colors and line may be set.
SETCUR sr er
Sets the cursor style to block, or line, by selecting the
starting 'sr' and ending 'er' rows for the cursor.
Page 13
Q U I C K R E F E R E N C E
SEBFU Version 2.2
SETDATE mm-dd-yyyy
Sets the Dos date to the specified date of mm-dd-yyyy, where :
mm = month in two decimal digit format, 01 thru 12
dd = day of month in two decimal digit format
yyyy = year in 4 decimal digit format
NOTE: must use hyphens to separate month and day, and day and
year.
SETERR n
Sets the batch file errorlevel between 0 and 255 (n). Great for
testing batch files or when you need to branch based on an
errorlevel.
SETIME hh:mm:ss
Sets the Dos time to that specified in the above format, where :
hh = hours in 2 digit format (00 - 24)
mm = minutes in 2 digit format
ss = seconds in 2 digit format
NOTE: must use colons to separate the units of time.
SETMODE n
Sets the video mode to value n, where :
0 = 40x25 black & white (CGA)
1 = 40x25 color (CGA)
2 = 80x25 black & white (CGA, EGA & VGA)
3 = 80x25 color (CGA, EGA & VGA)
4 = 320x200 4 color graphics
5 = 320x200 4 color graphics - color burst off
6 = 640x200 2 color graphics
7 = Monochrome adapter
8 = 160x200 16 color graphics - low resolution - PCjr
9 = 320x200 16 color graphics - med. resolution - PCjr
10 = 640x200 4 color graphics - high resolution - PCjr
13 = 320x200 16 color graphics - EGA
14 = 640x200 16 color graphics - EGA
15 = 640x350 monochrome graphics - EGA
16 = 640x350 16 color graphics - EGA
SETPG p
Sets the active video page to page 'p'. Page numbers are from 1
thru 4 for CGA systems.
Page 14
Q U I C K R E F E R E N C E
SEBFU Version 2.2
SHOWVAR vname [/XNPpLcRlCbc fc]
Displays the variable 'vname'. This can be done, using the Dos
echo command, with the %vname%, but that usage includes showing
the variable name (IE... PATH=A:\), while SHOWVAR only shows the
actual variable (IE... A:\). The switches are as follows :
X = center variable on line
N = don't issue a line feed / carriage return
Pp = Page number 'p'
Lc = Left margin at column 'c'
Rl = Use line number 'l'
Cbc fc = Use background 'bc' and foreground 'fc'
colors. Separate the colors with a space.
SKEY
Returns an errorlevel of 0 if no keystroke is waiting, else if
one is ready, then an errorlevel of 1 is returned.
SNGLBOX sr sc er ec bc fc
Draws a box, using single line graphics, starting at row 'sr',
column 'sc' and ending at row 'er', column 'ec', using the
optional colors 'bc' and 'fc' (background an foreground).
SOUND [d t]
Sounds the speaker for about 1 second, or for duration 'd' and
tone 't'.
SROWS
Returns an errorlevel equal to the cursor row.
STRING r c bc fc [/P] [/Sp]
Displays or prints 'r' number of 'c' characters, where 'r' and
'c' are both decimal values. The background 'bc' and foreground
'fc' colors may be specified, and specifying '/P' will print
instead of displaying the string, while using '/Sp' will display
the string on the selected video page.
SUB vname v
Subtracts the decimal value 'v' from the Dos variable 'vname',
where v is a value in the range of 1 thru 9, 1 is the default.
Page 15
Q U I C K R E F E R E N C E
SEBFU Version 2.2
SWIDTH
Returns an errorlevel equal to the column width of the video
system in use. If your video system is in 80 column mode, then
this would return an errorlevel of 80.
WAIT n
Pauses the system for 'n' seconds or milliseconds. If 'n' is a
value larger than 9, then the pause is in milliseconds, while
values between 1 and 9 are in seconds.
WAITILL hh:mm:ss
Pauses the system until the specified time. The specified time
must be in the above format, including the colons. You may not
specify the time as either an hour, or hour and minutes, in other
words, the time must include hours, minutes and seconds. If the
correct time is not specified, then an errorlevel of 1 is
returned.
WAITM n
Pauses the system for 'n' minutes, where n may be a decimal value
between 1 and 9.
WHATDAY
Returns an errorlevel between 1 an 7 for the day of week, where :
1=Sunday 2=Monday
3=Tuesday 4=Wednesday
5=Thursday 6=Friday
7=Saturday
WHATHR
Returns an errorlevel equal to the hour of the day, in 24 hour
format. IE...2=2AM 14=2PM
WHATMIN
Returns an errorlevel equal to the current minute.
Page 16
Q U I C K R E F E R E N C E
SEBFU Version 2.2
WHATMO
Returns an errorlevel equal to the current month, where :
1=January 2=February
3=March 4=April
5=May 6=June
7=July 8=August
9=September 10=October
11=November 12=December
WHATYR
Returns and errorlevel equal to the number of years since 1980.
If the current year is 1988, then this function will return an
errorlevel of 8.
WRITE /LcRlPpXNCbc fc,message
WRITE message /LcRlPpXNCbc fc
Displays the string 'message', using the following options :
Lc = use left margin 'c'
Rl = use line 'l'
Pp = use page 'p'
X = center on line
N = no CR/LF at end of line
Cbc fc = color, where :
bc = background
fc = foreground
Notice the comma between the message and the switch list, in the
first syntax version, this is required, only in the first syntax.
WRITEF fname [/Pp]
Displays file 'fname' (max of 4 kbytes), using the current column
position as the left margin, starting at the current line number,
using any existing colors as already may be on the display. The
optional page 'p' may be specified with the '/P' switch.
XMSCK
Returns an errorlevel of 1 if an extended memory device driver
has been installed, else returns an errorlevel of 0.
Page 17
Q U I C K R E F E R E N C E
SEBFU Version 2.2
YN [message]
Returns an error level of 1 if the 'n' key is depressed or a 0 if
the 'y' key is depressed. YN accepts either upper or lower case,
and any key depressed but Y or N results in the speaker beeping.
Optionally a message may be displayed, at the current cursor
position.
YRSINCE yyyy
Returns an errorlevel equal to the difference of the current date
subtracted from the specified date yyyy. If the date is entered
as 2 digits, then the century is assumed to be 1900.
YRSTILL yyyy
Returns an errorlevel equal to the difference of the current year
and the specified year. If the specified year is 2 digits, then
the year is assumed to be in the 19th century.
C O L O R S
When specifying colors for any of our functions, use the
following guidelines. These values may vary depending upon
adaptor.
0 = Black 1 = Blue 2 = Green 3 = Cyan
4 = Red 5 = Magenta 6 = Brown 7 = Gray
8 = Dark Gray 9 = Light Blue 10 = Light Green 11 = Light Cyan
12 = Light Red 13 = Light Magenta 14 = Yellow
15 = White
Page 18